package com.example.blog.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * @ClassName: psotClassInfo
 * @Description: 帖子分类

 * @Date 2024/2/5
 * @Version 1.0
 */
@Table(name = "psotClassInfo")
@Data
@Slf4j
@Entity
@Builder
@DynamicInsert
@DynamicUpdate
@AllArgsConstructor
@NoArgsConstructor
public class PostClassInfo {
    @Id
    @GeneratedValue(generator = "faceset_generator")
    @GenericGenerator(name = "faceset_generator", strategy = "uuid")
    @Column(name = "id",nullable = false,columnDefinition = "varchar(64) not null comment '主键id'")
    private String id;
    @Column(name = "name",nullable = false,columnDefinition ="varchar(128) not null comment '分类名称'")
    private String name;
    @Column(name = "creTime",nullable = false,columnDefinition ="datetime not null comment '创建日期'")
    private Date creTime;
    @Column(name = "creUser",insertable = true,updatable = false,columnDefinition ="varchar(128) not null comment '创建者'")
    private String creUser;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "updateTime",columnDefinition ="datetime not null comment '更新时间'")
    private Date updateTime;
    @Column(name = "updUser",columnDefinition ="varchar(128) not null comment '更新者'")
    private String updUser;
}
